/**
 * 
 */
package org.nyblom.riskcalc.calculate.impl;

import java.util.Random;

/**
 * @author qw4z1
 *
 */
public class DiceRoller {

	/**
	 * Simulates a number of dice rolls and returns the results in an array
	 * @param nRolls number of dice to be rolled
	 * @return int[] array with the results from the die rolls
	 */
	public static int[] roll(int nRolls) {
		int[] result = new int[nRolls];
		Random dice = new Random();
		for(int i = 0; i<nRolls; i++){
			result[i] = dice.nextInt(6) + 1;
		}
		
		return result;
	}

}
